<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>书籍展示</title>
</head>
<body>
    <h1>数据展示</h1>
    <a href="${pageContext.request.contextPath}/book/toAddPaper">增加书籍</a>
    <form action="${pageContext.request.contextPath}/book/allBook" method="get">
        名称：<input type="text" name="searchName" value="${searchName}">
        <input type="submit" value="查询">
    </form>
    <table border="1">
        <thead>
            <tr>
                <th>ID</th>
                <th>名称</th>
                <th>数量</th>
                <th>描述</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
        <c:forEach var="book" items="${list}">
            <tr>
                <td>${book.bookID}</td>
                <td>${book.bookName}</td>
                <td>${book.bookCounts}</td>
                <td>${book.detail}</td>
                <td>
                    <a href="${pageContext.request.contextPath}/book/toUpdatePaper?id=${book.bookID}">修改</a>&nbsp;|&nbsp;
                    <a href="${pageContext.request.contextPath}/book/deleteBook?id=${book.bookID}">删除</a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</body>
</html>
